1.

Solve : Retrieve last field in each line?

Answer»

I WANT to read a LINE from a text file, and am interested in assigning the last field to a variable. How do I do this without hardcoding the position, I want the script to be flexible ENOUGH to handle varying number of columns.Is the 'text' file space delimited?We have been asked to supply script code to extract the last "field" from a line of text, but we have not been told how the fields are delimited. Dusty has already asked about this. Until this is known, it will be difficult to PROVIDE a suitably robust SOLUTION.



Discussion

No Comment Found