New To Programming

Hello all!!
I am new to programming, and to this forum. :smiley:
I am having sort of a problem. Me and my coworker are working on a code, both of us are stumped on a few things.
One is we have a whole log file, i have found how to extract by column, but not by row. I need to extract by both.:confused:

For example..
I need rows 302 - 463
and columns 53-68
This is just a small portion of the log file, but it is all i need to "compare" to another file.

i hope this is clear enough for everyone, please feel free to ask any other questions if not.

thanks =)

Can you show us what you and your coworker have attempted so far?

Regards

I need rows 302 - 463

>cat mylog | head -463 | tail -162 

the head takes the first 463 lines
the tail takes the last 162 (remember to add one; for example if I want lines 99 and 100 that is two lines!)

and columns 53-68

>cat mylog | cut -c53-68

Note that these two can be put together as

>cat mylog | head -463 | tail -162 | cut -c53-68

It would be better if we use -f in stead of -c in cut command.

the -f parameter is for fields separated by a delimeter character, that may be set by a -d parameter

the -c parameter extracts data based on absolute character position

Based on the initial user request

the -c option accomplishes this. I have no idea how the -f could do the same.

if u can get the row number, u can use "sed" as following
sed -e '1,301d' -e '364,$d' mylog >log_result

as it delete from row number 1 to numer 301 , and from 364 to the end of ur log, then write the rest of the log to log_result

Thanks again everyone,
I have another question
I have two files, that have the same data in them excluding a few things. I want to compare these two files but they are not in the same order.

for example..
all of the data in the file looks similar to this

E00401001D011029
E00401001D01102D

etc
but they are not in the same order, and when i use the diff file.txt file2txt command it spits out a bunch of random stuff that i dont want, i just want to compare the two files and find the differances. Is there a way i can sort them so they look alike and then it will find the differances? or is there a way i can look through them and find the differances that way.

Thanks a bunch!

As per the requirement the requester needs to extract 53rd to 68th columns. Not the character. If it is 53rd character to 68th character the -c option is perfectly right but if it is column then I think -f is the better one.