User Profile
Collapse
-
Here's the problem, Paul:
when I just cut the file1_test I'll receive different output:
$ cut -c 63-78 file1_test
454353455434463 7
524353454353401 7
534534534534437 0
545435345344550 5
544534543534221 6
and then the second cut:
$ cut -c 183-188 file1_test
970232
R63908
941080
711285
053621
But...Leave a comment:
-
-
-
Ok, Paul, I know what you mean, so I've uploaded 2 test files, each one with 5 records/lines at: http://thetechiebuddy. com/hm/
The filenames are file1_test and file2_test. I've amended the records - so they're not real data....what I like:
search line by line and get string1 (length=16, position 63-78) and string2 (length=6, positions (183-188) in file1_test
...then
search for those 2 strings...Leave a comment:
-
Thanks a lot for your help...just tried the latest example...since the output of every line gets into $LINE, the positions are now changed and I had to change from-to in the command cut.... the results were not correct though....it somehow changed the look of each line - perhaps it was cause by spaces, slashes and various characters.
Is there another way like excluding read lines by lines, instead direct cutting with command cut and...Leave a comment:
-
When I inserted the code and run, it says:
0403-057 Syntax error at line 5 : `(' is not expected.
Can this be fixed please?Leave a comment:
-
It's like this, file#1:
[line 1]124323432423 423423423423423 423443243243432 432424
[line 2]432432432 4234234 434324324 434342343242342 3423
extract only for example positions: 1-6 and then 20-27 that is 2 strings from this file...
so from line 1: string1=124323 and string2=2342342
and THEN lookup these 2 strings in file#2, that is if there any line in file#2 that contains both string1 and...Leave a comment:
-
Thanks...and if not every record has the same column layout? Is there a possibility extract those 2 fields from certain position in the first file and look them up in the second file?Leave a comment:
-
grep or a simple script?
Since I found this very helpful forum and friendly people, I have a small request.
I use AIX Unix and would like to know if there's a simple way how to do a kind of compare between two files. Should I use some grep or script?
I have 2 text files, let's name them file1 and file2.
What I need:
I want to read line by line file1 - certain field or better 2 fields of the file1 and look up the...
No activity results to display
Show More
Leave a comment: