05-26-2009
convert a pipe delimited file to a':" delimited file
i have a file whose data is like this::
osr_pe_assign|-120|wg000d@att.com|4|
osr_evt|-21|wg000d@att.com|4|
pe_avail|-21|wg000d@att.com|4|
osr_svt|-11|wg000d@att.com|4|
pe_mop|-13|wg000d@att.com|4|
instar_ready|-35|wg000d@att.com|4|
nsdnet_ready|-90|wg000d@att.com|4|
osr_nvt|-1|wg000d@att.com|4|
port_ip_assignment|-35|wg000d@att.com|4|
i want to convert this pipe delimited file to ":" delimited file in such a way that the there is no colon at the end of each row.
plzzzz help
urgent
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi, could some help me convert CSV file (with double quoted strings) to pipe delimited file:
here you go with the same data:
1,Friends,"$3.99 per 1,000 listings",8158here " 1,000 listings " should be a single field.
Thanks,
Ram (8 Replies)
Discussion started by: Ram.Math
8 Replies
2. Shell Programming and Scripting
Hi All,
I have space delimited file similar to the one as shown below.. I need to convert it as a pipe delimited, the values inside the pipe delimited file should be as highlighted...
AA ATIU2345098809 009697 005374
BB ATIU2345097809 005445 006518
CC ATIU9685098809 003215 003571
DD... (7 Replies)
Discussion started by: nithins007
7 Replies
3. Shell Programming and Scripting
I have a file which was pipe delimited, I need to make it tab delimited. I tried with sed but no use
cat file | sed 's/|//t/g'
The above command substituted "/t" not tab in the place of pipe.
Sample file:
abc|123|2012-01-30|2012-04-28|xyz
have to convert to:
abc 123... (6 Replies)
Discussion started by: karumudi7
6 Replies
4. Shell Programming and Scripting
I have a csv data file :
A,B,C,D,"A,B",E,"GG,H"
E,F,G,H,I,J,"S,P"
I need to replace all "," with "|" except the ones between double quotes i.e
A|B|C|D|"A,B"|E|"GG,H"
E|F|G|H|I|J|"S,P"
CAn someone assist? (8 Replies)
Discussion started by: Shivdatta
8 Replies
5. Shell Programming and Scripting
Hi All,
I need a unix script to convert .csv files to .skv files (changing a comma delimited file to a semi colon delimited file). I am a unix newbie and so don't know where to start. The script will be scheduled using cron and needs to convert each .csv file in a particular folder to a .skv... (4 Replies)
Discussion started by: CarpKing
4 Replies
6. Shell Programming and Scripting
Hi guys,
I need to know how i can ignore Pipe '|' if Pipe is coming as a column in Pipe delimited file
for eg:
file 1:
xx|yy|"xyz|zzz"|zzz|12...
using below awk command
awk 'BEGIN {FS=OFS="|" } print $3
i would get xyz
But i want as :
xyz|zzz to consider as whole column... (13 Replies)
Discussion started by: rohit_shinez
13 Replies
7. UNIX for Dummies Questions & Answers
Hi, I have a rquirement in unix as below .
I have a text file with me seperated by | symbol and i need to generate a excel file through unix commands/script so that each value will go to each column.
ex:
Input Text file:
1|A|apple
2|B|bottle
excel file to be generated as output as... (9 Replies)
Discussion started by: raja kakitapall
9 Replies
8. Shell Programming and Scripting
Hello, I need to get few values from a XML file and output needs to be written in another file with pipe delimited format. The Header & Footer of the Pipe Delimited file will be constant.
The below is my sample XML file. I need to pull the values in between the XML tags <Operator_info to... (15 Replies)
Discussion started by: karthi1305561
15 Replies
9. Shell Programming and Scripting
Hi All,
How can we convert pipe delimited ( or comma ) file to vertical tab (VT) delimited.
Regards
PK (4 Replies)
Discussion started by: prasson_ibm
4 Replies
10. Shell Programming and Scripting
I have file in linux with comma delimited and string fields in double quotations ", I need to convert them to pipe delimiter please share your inputs.
Example:
Input:
"2017-09-30","ACBD,TVF","01234",NULL,18,NULL,"686091802","BANK OF ABCD, LIMITED, THE",790456
Output:
... (4 Replies)
Discussion started by: shieksir
4 Replies
NDB(8) System Manager's Manual NDB(8)
NAME
query, mkhash, mkdb, cs, csquery, dns, dnsquery - network database
SYNOPSIS
ndb/query attr value [ rattr ]
ndb/mkhash file attr
ndb/cs [ -n ] [ -f dbfile ]
ndb/csquery
ndb/dns [ -s ] [ -f dbfile ]
ndb/dnsquery
ndb/mkdb
DESCRIPTION
The network database holds administrative information used by network programs such as bootp(8), ipconfig(8), con(1), etc.
Ndb/query searches the database for an attribute of type attr and value value. If rattr is not specified, all entries matched by the
search are returned. If rattr is specified, the value of the first pair with attribute rattr of all the matched entries is returned.
Ndb/mkhash creates a hash file for all entries with attribute attr in database file file. The hash files are used by ndb/query and by the
ndb library routines.
Ndb/cs is a server used by dial(2) to translate network names. Option -f supplies the name of the data base file to use, default
/lib/ndb/local. It is started at boot time. It finds out what networks are configured by looking for /net/*/clone when it starts. It can
also be told about networks by writing to /net/cs a message of the form:
add net1 net2 ...
Ndb/cs also sets the system name in /dev/sysname if it can figure it out. Option -n causes cs to do nothing but set the system name.
Ndb/csquery can be used to query ndb/cs to see how it resolves addresses. Ndb/csquery prompts for addresses and prints out what ndb/cs
returns.
Ndb/dns is a server used by ndb/cs and by remote systems to translate Internet domain names. Ndb/dns is started at boot time. By default
dns serves only requests written to /net/dns. Option -s causes the server to also answer domain requests sent to UDP port 53. Name reso-
lution is performed by searching the local database and by querying remote servers. The server for a domain is indicated by a database
entry containing both a dom and a ns attribute. For example, the entry for the Internet root is:
dom=
ns=ns.nic.ddn.mil
ns=kava.nisc.sri.com
ns=aos.brl.mil
The root of a domain subtree served by the local database is indicated by an entry with an soa attribute. For example, the AT&T research
domain is:
dom=research.att.com soa
mb=ches.research.att.com
ns=inet.research.att.com
ns=research.research.att.com
Here, the mb entry is the mail address of the person responsible for the domain (default postmaster). Wild-carded domain names can also be
used. For example, to specify a mail forwarder for all AT&T research systems:
dom=*.research.att.com
mx=research.att.com
Ndb/dnsquery can be used to query ndb/dns to see how it resolves requests. Ndb/dnsquery prompts for commands of the form
domain-name request-type
where request-type can be ip, mx, ns, cname, ptr.... In the case of the inverse query type, ptr, dnsquery will reverse the ip address and
tack on the .in-addr.arpa for you.
Ndb/mkdb is used in concert with awk(1) scripts to convert uucp systems files, IP host files, and Datakit configuration files into database
files. It is very specific to the situation at Murray Hill.
When the database files change underfoot, ndb/cs and ndb/dns track them properly. Nonetheless, to keep the database searches efficient it
is necessary to run ndb/mkhash whenever the files are modified. It may be profitable to control this by a frequent cron(8) job.
EXAMPLES
% ndb/query sys helix
sys=helix dom=helix.research.att.com bootf=/mips/9powerboot
ip=135.104.117.31 ether=080069020427
dk=nj/astro/helix
proto=il
% ndb/query sys helix ip
135.104.117.31
% ndb/dnsquery
> 9net.research.att.com ip
9net.research.att.com ip 192.20.225.252
> 192.20.225.252 ptr
252.225.20.192.in-addr.arpa ptr 9net.research.att.com
>
FILES
/lib/ndb/local
first database file searched
/lib/ndb/local.*
hash files for /lib/ndb/local
/srv/cs
service file for ndb/cs
/net/cs
where /srv/cs gets mounted
/srv/dns
service file for ndb/dns
/net/dns
where /srv/dns gets mounted
SOURCE
/sys/src/cmd/ndb
SEE ALSO
ndb(2) ndb(6)
NDB(8)