cobol >> Extract a piece of information from a txt file
by TekSoft » Sat, 19 Jun 2004 01:07:00 GMT
Hi,
I've a txt file with several lines with not fixed length and I use
PowerCobol v7.
I want to extract a number between this character "@" and "\n" (carriage
return/line feed). For example:
4555599544455.455565@555555
XXXX@XXXXX.COM @60.398 >> this is it
1144@555555@58588888888888888@89898
and I want to extract this number "60.398" from the second line. I can I do
it?
Thanks
JM
Euromercante
cobol >> Extract a piece of information from a txt file
by Frederico Fonseca » Sat, 19 Jun 2004 05:02:01 GMT
Use the unstring statement with a delimiter of "@".
e.g.
unstring fieldx delimited by all "@"
into field1, field2, field3, field4
On the above case result would be
line 1
field1 4555599544455.455565
field2 555555
Line 2
field1 XXXX@XXXXX.COM
field2 60.398
Line 3
field1 1144
field2 555555
field3 58588888888888888
field4 89898
Frederico Fonseca
ema il: frederico_fonseca at syssoft-int.com
Similar Threads
1. Extracting arrays into txt files
Hi!
I would like to know how to extract a full array into a txt file,
maintaining the samples and collums format, to export it to a excel
file or similar.
thanks
2. Extracting pieces off of a WAV file
3. Extracting file system information
Hi,
I've a C program that I need to include a routine to extract free space
information on a particular mount point. Can someone provide me a sample
routine on how that is done in C? I did a man on statvfs and it looks like
that is the system call I should be using but I'm not clear how to use it.
Any help you can provide is very much appreciated.
thanks.
geraldine
4. convert binary file to txt file
5. How to log execution of batch file in a txt file
I run a batch file, which is nothing but a make file of my project. It
also does linting for me.
Hence the execution of the batch file in the DOS window can be seen,
which is very huge(i have around 2000 .c files in the project)
Here i need to log the execution of the batch file in a .txt file so
that i can analyse the details of the execution.
The execution is so huge that i loose most of the execution-data from
the dos screen, and a small portion is available.
Thanks,
Abhay
6. Working with color, cursor, and png to extract information
7. extract all hotmail email addresses in a file and store in separate file
Tom ?hlidhe wrote:
> On Jun 18, 8:33 pm, Dennis < XXXX@XXXXX.COM > wrote:
>
>> 1. Strip out the " characters and just leave the email addresses on
>> each line.
>
> char const *const original = "\" XXXX@XXXXX.COM \"";
Please learn to look at the groups to which an article is posted and
strip out those for which your reply is not relevant. In this case
comp.lang.perl.misc.
--
Henry Law Manchester, England
8. extract all hotmail email addresses in a file and store in separate file