Twelve Methods to Parse a File Line by Line — Part 1

Hi Guys,

Today, In this series we learn 12 method to parse the file in Linux/Unix.

Method 1:

cat $FILENAME | while read LINE
function while_read_LINE
{
cat $FILENAME | while read LINE
do
echo "$LINE"
done
}

Method 2:

while read $FILENAME from Bottom ------------------ BEST_ONE
function while_read_LINE_bottom
{
while read LINE
do
echo "$LINE"
done < $FILENAME
}

Method 3:

while_line_LINE_Bottom
function while_line_LINE_bottom
{
while line LINE
do
echo $LINE
done < $FILENAME
}

njoy the simplicity…….

© Mastering Unix Shell Scripting

Advertisements

About victimizeit
This is Atul.. working for IBM as a DataStage Developer. I may not be an expert on any particular DataStgae technology, but I'm sure I do know a few things about DB2, AIX, Unix, Windows, and DataBase. In this blog, I'll give out some tips on these subjects. If you find them useful, great, I'll be happy. Thanks for stopping by !!

What is your opinion ?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: