-
help needed for simple unix command
Hi, all
I have a file to load into oracle database, in my source file, there are " " on the numbers, for instance, "12345", I need to get rid of the " ", but don't know the command, could someone help me, Thanks.
The file is too big, have to do on unix platform.
DF
Still learning
-
-
Didn't see your point. You want just to truncate all the spaces in the file? Try this:
sed 's/ //g' source_file > dest_file
mv dest_file source_file
An ounce of action is worth a ton of theory.
—Friedrich Engels
-
what I want is change "12345" to 12345. Thanks.
DF
Still learning
-
Well, you can remove all the symbols with:
sed 's/\"//g' source_file > dest_file
Otherwise, you'll have to run several commands like:
sed 's/\"1/1/' source_file > dest_file_1
sed 's/1\"/1/' dest_file_1 > dest_file_2
sed 's/\"2/2/' dest_file_2 > dest_file_3
.
.
and so on. Do as Jeff said, "man sed" and run it as a loop in a shell script.
An ounce of action is worth a ton of theory.
—Friedrich Engels
-
Thanks very much for all your help.
Still learning
-
If you will load it with sqlldr, you don't have to pre-parse the file, just use optionally enclosed by '"'
Tomaž
"A common mistake that people make when trying to design something completely
foolproof is to underestimate the ingenuity of complete fools" - Douglas Adams
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|