I'm not an SQL expert, but still believe this could all be done in SQL without needing awk or sed. And, you showed us the output you said you want with <space> as a field separator and then say that you want the output to be a CSV file with <comma> as the field separator??? Assuming that your input is in a file named file and that you do want output with <comma> as the field separator, the following awk script seems to do what I think you want:
If file contains the input you showed us in post #1 in this thread, this produces the output:
You haven't told us what operating system or shell you're using (which you should always do in threads in this forum so we can suggest solutions that will work in your environment). If you're using a Solaris/SunOS system, change awk to /usr/xpg4/bin/awk or nawk.
This User Gave Thanks to Don Cragun For This Post:
this is my output for my crawler.
/about.html
/ads/
/advanced_search?hl=en
froogle.google.com/frghp?hl=en&tab=wf&ie=UTF-8
groups.google.com/grphp?hl=en&tab=wg&ie=UTF-8
/imghp?hl=en&tab=wi&ie=UTF-8
/intl/en/options/
/language_tools?hl=en
/maphp?hl=en&tab=wl&ie=UTF-8... (3 Replies)
I am just wondering if it's possible to refer to variables within a sed statement as follows:-
cat $file | sed -e 1's/$oldtext/$newtext/' > $file
as when I run the script, the variables are not recognised and nothing happens..??
Thanks (5 Replies)
I am having some problems with sed, that I am hoping that I can get some assistance with. I am trying to remove two subsets of a string, and cannot figure out how to have it work.
Here is an example string:
auth_ldap authenticate: user joe authentication failed; URI /svn/
I want to... (4 Replies)
I'm searching the most effective way of doing the following task, so if someone can either provide a working solution with sed or one totally different but more effective then what I've got so far then please go ahead!
The debugme directory has 3 subdirectorys and each of them has one .txt file... (7 Replies)
I have following requirement.
Say, my text file contains following patterns
{2010501005|XXGpvertex|9|0|17|0|{|{30100001|XXparameter_set|@@@@{{30001002|XXparameter|!prototype_path|$AB_COMPONENTS/Sort/Sort.mpc|3|2|Pf$|@{0|}}
}}@0|@315000|78500|335000|99000|114000|87000|17|And the Sort|Ab... (8 Replies)
Hi,
I have an array with characters and I am looking for specific character in that array and if those specific character not found than I use goto statment which is define somehwhere in the script. My code is:
set a = (A B C D E F)
@ i = 0
while ($i <= ${#a})
if ($a != "F" || $a != "D")... (3 Replies)
Hi There,
I am trying to load data from a csv file into a DB during our DB migration phase. I am successfully able export all data into a .csv file but those have to rewritten in terms insert statement which will allow for further population of same data in different DB
My exiting csv record... (6 Replies)
Hello Guys,
I am new here and this is my first post, hope someone can help me
I am writing a script that is supposed to go in 9 different directories and edit a given file in each of the directories. I am using sed to edit the file as
sed -i 'line# s/#to be changed/#to be replaced with/... (5 Replies)
Hi folks,
I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex.
I have a bunch of update statements with all columns in a file which I need to convert into insert statements.
UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Hello folks,
I have multiple occurrences of the pattern:
).:
where is any digit, in various text context but the pattern is unique as this regex. And I need to turn this decimal fraction into an integer (corresponding percent value: the range of 0-100).
What I'm doing is:
cat... (1 Reply)
Discussion started by: roussine
1 Replies
LEARN ABOUT DEBIAN
which-pkg-broke
which-pkg-broke(1) debian-goodies which-pkg-broke(1)NAME
which-pkg-broke - find which package might have broken another
SYNOPSIS
which-pkg-broke package
DESCRIPTION
The which-pkg-broke program will retrieve a list of the named package and all its dependencies sorted by the time they were installed on
the system (as determined from the mtime information of /var/lib/dpkg/info/*.list .
This tool makes it possible for a system admin to obtain information that might correlate installation of package dependencies with a pack-
age breakage in order to find which package update might be responsible for the breakage.
EXAMPLES
This tool can be useful determine which package dependencies were upgraded more recently and might be associated with the bug that is being
observed. For example, if aptitude stops working properly, an administrator can run:
$ which-pkg-broke aptitude
Package <libapt-pkg-libc6.3-5-3.3> has no install time info
libdb1-compat Fri Aug 8 03:02:11 2003
libsigc++-1.2-5c102 Fri Aug 8 05:15:58 2003
aptitude Sun Jan 11 17:38:06 2004
libncurses5 Sun Jan 18 08:11:05 2004
libc6 Thu Jan 22 07:55:10 2004
libgcc1 Tue Jan 27 07:37:22 2004
gcc-3.3-base Tue Jan 27 07:37:31 2004
libstdc++5 Tue Jan 27 07:37:32 2004
So depending on exactly when the misbehaviour started, there may be a reason to point the finger at a more-recently updated library like
libstdc++ or libncurses, which are more-recently installed than aptitude itself.
SEE ALSO rc-alert(1)AUTHOR
which-pkg-broke was written by Bill Gribble <grib AT billgribble.com>
This manual page was written by Javier Fernandez-Sanguino for the Debian GNU/Linux distribution.
debian-goodies July 24 2006 which-pkg-broke(1)