I'll get a file whose 2nd line contains 3 fields: filename(variable length), file size char(10), and record count int(10). How do I cut it and put it into 3 variables?
eg: abcd.csv01234567891111111111
now I want: $one = abcd.csv, $two = 0123456789, $three = 1111111111.
I also want to check for the file size (excluding first 2 lines of the file) and put it in another variable say $four. If the variable $two doesn't match with $four then generate an error code say: 150.
Any Help would be appreciated.
I am sorry as I was not clear enough.
"File size" means: calculate the size of the file in terms of bytes excluding first 2 lines, store that in a variable say $four and comparing it with $two (as I mentioned earlier) and generate error code say 150 if it doesn't match.