Results 1 to 9 of 9
if I write this command for examle
Code:
find ./ ! -mtime -$input -type f | xargs ls -tg
result is
Code:
-r--r--r-- 1 eaf 7700 May 11 2005 ./.openoffice/LICENSE
...
- 08-07-2007 #1Just Joined!
- Join Date
- Jul 2007
- Posts
- 31
How can I convert data to table?
if I write this command for examle
result isCode:find ./ ! -mtime -$input -type f | xargs ls -tg
How can I convert data to table, like EXCEL?Code:-r--r--r-- 1 eaf 7700 May 11 2005 ./.openoffice/LICENSE -r--r--r-- 1 eaf 8244 May 11 2005 ./.openoffice/LICENSE.html -r--r--r-- 1 eaf 13982 May 11 2005 ./.openoffice/README -r--r--r-- 1 eaf 12714 May 11 2005 ./.openoffice/README.html
Last edited by devils casper; 08-07-2007 at 06:41 AM. Reason: Added code tags and removed formatting.
- 08-07-2007 #2
Are you writing a script to do this or do you want to open it in OpenOffice?
If you would like to open the data in OpenOffice Spreadsheet as a table then make sure you output the data into CSV file (Comma Separated Values) and simply open the CSV file in OpenOffice Spreadsheet, it will then open as a table. From what I can see though you are outputting into tabbed spacing in which case you could then import it into a spreadsheet as tabbed values. But in all honesty just make a script and put it into csv, nice, easy, clean and widely supported.
- 08-07-2007 #3Just Joined!
- Join Date
- Jul 2007
- Posts
- 31
yes I wont to open the output in table like EXCEL but I try to open output data into CSV file but iit does not give me what I wont. I need to put data in table has raw line and colomn line not written like table I wont to be in real tabll(EXCEL)
and I wont this table to be editable so I can add new colomn in it
and if ther is acommand to rename title of each colom it will be grate
- 08-07-2007 #4
I believe that Excel can export to a tab-delimited file. Can it not import a tab-delimited file?
And what do you mean it didn't accept a CSV file? I know for a fact that Excel can take in CSV files.DISTRO=Arch
Registered Linux User #388732
- 08-08-2007 #5Just Joined!
- Join Date
- Jul 2007
- Posts
- 31
"calc" and "Excel" does not open file probarlyt put All colomn Under one colomn
there is program can open CSV file in linux whiich is "calc"but it doesnot open it probarly
it put All colomn Under one colomn
or exeample
-r--r--r-- 1 eaf 7700 May 11 2005 ./.openoffice/LICENSE
-r--r--r-- 1 eaf 8244 May 11 2005 ./.openoffice/LICENSE.html
-r--r--r-- 1 eaf 13982 May 11 2005 ./.openoffice/README
-r--r--r-- 1 eaf 12714 May 11 2005 ./.openoffice/README.html
-rw-r--r-- 1 eaf 567 May 11 2005 ./.openoffice/user/autotext/mytexts.bau
-rw-r--r-- 1 eaf 976 May 11 2005 ./.openoffice/user/basic/dialog.xlc
all of this data under one colomn
and what it shold be SEPERAT like
"-r--r--r--" in colomn A "1 eaf" in colomn B
" 7700 " in colomn C "May 11 2005" in colomn D
"./.openoffice/LICENSE" in colomn E
even that Excel did not seprat colomn (did not put every colomn data in separat colomn)
so any solution tothis proplem
- 08-08-2007 #6Linux Enthusiast
- Join Date
- Aug 2006
- Posts
- 631
Seperate the fields with a comma, try this:
RegardsCode:awk '{printf("%s, %s %s,%s,%s %s %s,%s\n", $1, $2, $3, $4, $5, $6, $7, $8)}' < file > file.csv
- 08-08-2007 #7
- 08-08-2007 #8Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
The example you gave above is not a CSV file. CSV is [i]Comma[/u] Seperated Values whereas the input you provided is seperated by spaces or tabs. In either case you can specify a fixed width import and define the line breaks when importing or take Franklin52's suggestion which is to insert commas.
- 08-11-2007 #9Just Joined!
- Join Date
- Jul 2007
- Posts
- 31
#!/bin/csh -f
#echo "Enter numbar of day to search for not modify file"
set directory = $1
set days = $2
#find ./ ! -mtime -$days -type f | xargs ls -tg > files_list.csv
find $directory ! -mtime -$days -type f | xargs ls -tg > files_list.csv
more files_list.csv


Reply With Quote
