Sponsored Content
Top Forums Shell Programming and Scripting Help Replacing Characters in Flat File Post 302117975 by vgersh99 on Thursday 17th of May 2007 11:54:43 AM
Old 05-17-2007
Quote:
Originally Posted by Shell_Life
Nelson,
Per my previous reply, your sample led me to believe the following:
1) Every non-numeric field would be surrounded by double quotes.
except for "william".
2) Every numeric field would not be surrounded by double quotes.
If the specs give reason to question, no final solution will be found.
Shell,
this is a typical CSV conversion task - you cannot make any assumptions of what type of FIELD you're dealing with.
The only assumptions you can make are:
  1. This is a CSV-type file with ',' as a field separator
  2. There can be embedded ',' characters (plural) in any field
  3. some fields might be quoted with double-quotes
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

replacing few characters in a file

Hi All, I have huge xml file. The file contains some comment tags . I have requirement to replace comment tag with another comment tag. Say for example : file X has -- Part of the file <?xml version="1.0" encoding="ISO-2"?><translationResults jobDate="20070123 23:20:51"... (1 Reply)
Discussion started by: purnakarthik
1 Replies

2. UNIX for Dummies Questions & Answers

replacing the characters in a file

hi i want to replace the characters between positions 2 to 30 in each line in a file how to do it suggestions welcome (2 Replies)
Discussion started by: trichyselva
2 Replies

3. UNIX for Dummies Questions & Answers

Replacing characters in csv file

Hello all, This is my first post here, so please excuse me if this question is too obvious or has been asked before. I am new to Unix and although I tried to search your forum for the answer to my question, I could not find an answer that would help me. I have a 500MB csv file with numeric values... (1 Reply)
Discussion started by: finwhiz
1 Replies

4. UNIX for Advanced & Expert Users

foreign characters in flat file

Hey, Is there anyway I anks, Pocha (12 Replies)
Discussion started by: pochaman
12 Replies

5. Shell Programming and Scripting

Merge lines in Flat file based on first 5 characters

Hi I have the fixed width flat file having the following data 12345aaaaaaaaaabbbbbbbbbb 12365sssssssssscccccccccc 12365sssss 12367ddddddddddvvvvvvvvvv 12367 vvvvv Here the first column is length 5 second is length 10 third is length 10 if the second or third column exceeds... (3 Replies)
Discussion started by: Brado
3 Replies

6. AIX

How to cut a flat file according to a certain number of characters?

hello everybody i am looking for a shell to cut a flat file (with a long unique line) according to a certain number of characters and redirect every result to an output file. here is an example MyFile : 12 3 456 12 3 456 12 3 456 ..... and i took every 9-characters including BLANKS... (6 Replies)
Discussion started by: fastlane3000
6 Replies

7. UNIX for Dummies Questions & Answers

How to remove numeric characters in the flat file

HI, can any one help me please .. i have flat file like qwer123rt ass3242ccf jjk654 kjh838ppp nhdg453ok hdkk34 i want remove numeric characters in the flat file i want output like this qwerrt assccf jjk kjhppp nhdgok hdkk help me... (4 Replies)
Discussion started by: rafimd1985
4 Replies

8. Shell Programming and Scripting

Finding distinct characters from flat file

Hi....I need one help.... I'm having a files which is having the data as follows... a b c c d d d e f Now I need to find out distinct characters from this file and the output should be as follows - a b c d e f Can you please help me on this? I'm using KSH script. (18 Replies)
Discussion started by: Krishanu Saha
18 Replies

9. Shell Programming and Scripting

Replacing multiple spaces in flat file

Greetings all I have a delimited text file (the delimiter is ';') where certain fields consist of many blanks e.g. ; ; and ; ; Before I separate the data I need to eliminate these blanks altogether. I tried the sed command using the following syntax: sed -i 's/; *;/;;/g' <filename> ... (15 Replies)
Discussion started by: S. BASU
15 Replies

10. UNIX for Advanced & Expert Users

Replacing characters in a file

Suppose I have a file which has 1000 columns (5 SHOWN FOR EXAMPLE) two alphabets are separated by a space and then tab A A"\t"C C"\t"G G"\t"0 0"\t"T T A G"\t"C C"\t"G G"\t"A T"\t"0 0 G A"\t"0 0"\t"G C"\t"A A"\t"T C whenever there is a 0 0 in any column, the output should be printed as A... (12 Replies)
Discussion started by: rossi
12 Replies
inc::Module::Install::DSL(3pm)				User Contributed Perl Documentation			    inc::Module::Install::DSL(3pm)

NAME
inc::Module::Install::DSL - Domain Specific Language for Module::Install SYNOPSIS
use inc::Module::Install::DSL 0.80; all_from lib/ADAMK/Repository.pm requires File::Spec 3.29 requires File::pushd 1.00 requires File::Find::Rule 0.30 requires File::Find::Rule::VCS 1.05 requires File::Flat 0 requires File::Remove 1.42 requires IPC::Run3 0.034 requires Object::Tiny 1.06 requires Params::Util 0.35 requires CPAN::Version 5.5 test_requires Test::More 0.86 test_requires Test::Script 1.03 install_script adamk requires_external_bin svn DESCRIPTION
One of the primary design goals of Module::Install is to simplify the creation of Makefile.PL scripts. Part of this involves the gradual reduction of any and all superfluous characters, with the ultimate goal of requiring no non-critical information in the file. Module::Install::DSL is a simple Domain Specific Language based on the already-lightweight Module::Install command syntax. The DSL takes one command on each line, and then wraps the command (and its parameters) with the normal quotes and semi-colons etc to turn it into Perl code. SUPPORT
Bugs should be reported via the CPAN bug tracker at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Module-Install <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Module-Install> For other issues contact the author. AUTHORS
Adam Kennedy <adamk@cpan.org> COPYRIGHT
Copyright 2008 - 2012 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-03-01 inc::Module::Install::DSL(3pm)
All times are GMT -4. The time now is 01:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy