11-01-2009
Hi
I type this:
for FILE in *.txt; do NEWFILE=new-$FILE; cut -d ' ' -f1 $FILE > $NEWFILE; done
but it just copied the file like that into another file with the new name
Let me know what mistake I did
10 More Discussions You Might Find Interesting
1. UNIX Desktop Questions & Answers
I would like to copy 2 parts of a csv file from Unix to an XL sheet. However to save time I do not want to format the column ever time I cut and paste into XL(Text2Column). I've used awk -F, '{Print $1, $2....}'. Is there a script or code that can automatically format the csv for XL columns?
... (3 Replies)
Discussion started by: ravzter
3 Replies
2. Shell Programming and Scripting
Dear All,
I have requirement like this:
I have 2 camma seperated files
file1:
1,aaa,bbb,ccc,
2,bbb,ccc,ddd,
3,ccc,ddd,eee,
file2:
1,aaa,bbb,ccc,
2,bbb,ddd,ddd,
3,ccc,ddd,eee,
my requirement is I should get message in the out put like:
There is a difference in 3 rd filed in... (2 Replies)
Discussion started by: mymoto
2 Replies
3. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Hi All,
I am new to unix, my requirement is like need to find the files like DATA_FUNCTION* and put those... (1 Reply)
Discussion started by: madsongtel
1 Replies
4. Shell Programming and Scripting
I am in the process of creating a BASH shell scripts for a project at work. So the scenario is as such:
I have a file with each line entry separated by ':'
... (3 Replies)
Discussion started by: metallica1973
3 Replies
5. Shell Programming and Scripting
Hello there,
I have a comma separated csv , and all the text field is wrapped by double quote. Issue is some text field contain comma as well inside double quote. so it is difficult to process.
Input in the csv file is ,
1,234,"abc,12,gh","GH234TY",34
I need output like below,... (8 Replies)
Discussion started by: Uttam Maji
8 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I have a large number of files which are written as csv (comma-separated values).
Does anyone know of simple sed/awk command do achieve this?
Thanks!
---------- Post updated at 10:59 AM ---------- Previous update was at 10:54 AM ----------
Guess I asked this too soon. Found the... (0 Replies)
Discussion started by: lost.identity
0 Replies
7. Shell Programming and Scripting
Hi,
I want to change a file file1.txt:
1234
3456
2345
6789
3456
2333
4444
As, file2.txt in Linux:
'1234','3456','2345','6789','3456','2333','4444'
Could someone please help me. (Single liner sed, awk will be welcome!) (7 Replies)
Discussion started by: wiweq05
7 Replies
8. Shell Programming and Scripting
Hi Everyone,
On my Linux box I have a text file having block of few lines and this block lines separated by one blank line. I would like to format and print these lines in such a way that this entire block of lines will come as single comma separated line & again next block of lines in next... (7 Replies)
Discussion started by: gr8_usk
7 Replies
9. Shell Programming and Scripting
Hi,
I have a list of tables in a file.txt
C_CLAIM
C_HLD
C_PROVIDER
I want the output to be
'C_CLAIM','C_HLD','C_PROVIDER'
Currently I'm usin awk and getting output which is almost correct but still has minor defects
awk -vORS="','" '{ print $1 }' file.txt
The output of... (4 Replies)
Discussion started by: wahi80
4 Replies
10. Shell Programming and Scripting
Hi Experts,
Please support
I have below data in file in comma seperated, but 4th column is containing comma in between numbers, bcz of which when i tried to parse the file the column 6th value(5049641141) is being removed from the file and value(222.82) in column 5 becoming value of column6.
... (3 Replies)
Discussion started by: as7951
3 Replies
ODIDX(1) Quick Database Manager ODIDX(1)
NAME
odidx - indexer of document files
SYNOPSIS
odidx register [-l file] [-wmax num] [-tsuf sufs] [-hsuf sufs] name[dir]
odidx relate name
odidx purge name
DESCRIPTION
This manual page documents briefly the odidx commands.
The command odidx is a utility for indexing files on the local file system. This command is useful for a full-text search system of a Web
site. Supported file format are plain text and HTML. Supported character encoding are US-ASCII and ISO-8859-1. The URI of each document is
specified with the path of its file. Attributes named as title and date are given to each documents. When a document is already existing in
the database, it is registered if its last modification time is newer, or it is ignored. Modification times are stored in the sub database
`_mtime' in the main database directory. Score information are stored in the sub database `_score' in the main database directory. This
command is used in the above format. name specifies a database name. dir specifies a directory name.
OPTIONS
A summary of options is included below. For a complete description, see the file:///usr/share/doc/qdbm-doc/spex.html#odeumcli.
-l file
read a file and get list of paths of files to register. If `-' is specified, the standard input is read.
-wmax num
specify the max number of words to be stored in the document database.
-tsuf sufs
specify suffixes of plain text files in comma separated format. The default is `-tsuf .txt,.text'.
-hsuf sufs
specify suffixes of HTML files in comma separated format. The default is `-hsuf .html,.htm'.
EXAMPLES
For example, to register files which are under `/home/mikio' and whose suffix are `.txt', `.c', or `.h', perform the following command.
odidx register -tsuf ".txt,.c,.h" -hsuf "" casket /home/mikio
Thus, to retrieve documents which include `unix' and `posix' and show the top 8 terms, perform the following command.
odmgr search -max 8 -h casket "unix posix"
SEE ALSO
qdbm(3), odmgr(1), odeum(3), odopen(3).
AUTHOR
QDBM was written by Mikio Hirabayashi <mikio@fallabs.com>.
This manual page was written by Fumitoshi UKAI <ukai@debian.or.jp>, for the Debian project (but may be used by others).
Man Page 2005-05-23 ODIDX(1)