Re: read file help



In article <4807701c$1@xxxxxxxxx>, George <@> wrote:
There is a file name file.txt with content below:
11 21 31 41
41 31 21 11
31 21 11 41

How can I read the file line by line, and then print the first three
columns(separed by tab)?

awk or perl would probably work well for this kind of application.

Your question is ambiguous; I see at least three possible
meanings:

1) print all of the members of the first column, *across*,
then print a tab, then print all of the members of the second
column *across*, then a tab, then all of the members of the
third column (still *across*.)

2) similar to the above, but with tabs between all the values

3) print the first member of the first column, then a tab,
then the first member of the second column, then a tab,
then the first member of the third column, then a newline,
print the second member of the first column, then a tab,
then the second member of the second column, then a tab,
then the second member of the third column, then a newline,
and so on, proceeding down the columns.


Also, it is ambiguous as to whether for some reason you need to
read the entire file before starting the printing, or if it would
be acceptable to print as you go.
--
"Nothing recedes like success." -- Walter Winchell
.



Relevant Pages

  • Re: not all member in the same page
    ... checked the website and it is similar with address sample of MS database. ... I have successfully made it in the form using tab of course with child and ... the member of the family is not gruop into 1 page, ... What I want is this serves as a letter to update each household data. ...
    (microsoft.public.access.reports)
  • Re: How to use paswords for 2nd and 3rd page
    ... 2nd and 3rd page is a confidential info of a member ... A Tab Control is JUST a way to manage screen real estate. ... Have you set up Access workgroup security on this database? ...
    (microsoft.public.access.forms)
  • Re: MFC and COM components
    ... I now can access this member in m_tabs: ... google on this and there is no MFC C/C++ example with this. ... For our 14 year old product "Makeover Stategy", what I am trying to do now is explore "making fancy" some of the MFC applets using some COM controls. ... I wonder why "adding the variable" for the component class only addd TabStrip but not the others Tabs and Tab. ...
    (microsoft.public.vc.mfc)
  • Re: Windows XP pro machine cannot change from workgroup to domain
    ... computer name tab, the member of section shows workgroup as mshome as ... if the machine were a xp home machine, and the option to change to ... Was the computer ever a member of a domain ...
    (microsoft.public.windowsxp.network_web)
  • Re: Find and replace
    ... Then select all the rows and insert a tab on ... Terry Farrell - Word MVP ... I want to delete the email addresses, leaving just the list of names. ... names in the first column and the addresses into the second column. ...
    (microsoft.public.word.newusers)