Sponsored Content
Top Forums Shell Programming and Scripting Minimum whitespace separated CSV file generation Post 302310673 by vharsha on Sunday 26th of April 2009 08:51:40 AM
Old 04-26-2009
it works

thanks a many Devaraj it works. u made my evening.
cheers.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

rename file with whitespace embedded

Say a directory contains files 1) "file name 1.xxx" 2) "file name2.yyy" 3) etc Using a cshell script, is there a way to (1)search for all files that contain " " in the filename and then (2)rename the files so that you replace the whiitespace " " with a "_". First problem I run into is... (6 Replies)
Discussion started by: orlando47
6 Replies

2. Shell Programming and Scripting

removing whitespace from middle of file -help

I have a file in which I clean out a bunch of nonsense text as well as path information. What I end up with is something like the following: johnson.........................................................933 Where the periods represent the whitespace The file comes out originally with... (2 Replies)
Discussion started by: roninuta
2 Replies

3. Shell Programming and Scripting

How to match (whitespace digits whitespace) sequence?

Hi Following is an example line. echo "192.22.22.22 \"33dffwef\" 200 300 dsdsd" | sed "s:\(\ *\ \):\1:" I want it's output to be 200 However this is not the case. Can you tell me how to do it? I don't want to use AWK for this. Secondly, how can i fetch just 300? Should I use "\2"... (3 Replies)
Discussion started by: shahanali
3 Replies

4. UNIX for Dummies Questions & Answers

Getting the minimum of each column in a file

Hi, I have a file like: 0.000000 124.085533 124.085533 124.085533 124.085533 124.085533 124.085533 124.085533 124.085533 124.085533 33.097845 33.363764 0.000000 266.483441 262.519130 266.380993 274.989622 289.594799 309.523518 336.124848 372.386124 413.522043 429.984825 421.621810... (6 Replies)
Discussion started by: cosmologist
6 Replies

5. Shell Programming and Scripting

Text file to CSV with field data separated by blank lines

Hello, I have some data in a text file where fields are separated by blank lines. There are only 6 fields however some fields have several lines of data as I will explain. Also data in a particular field is not consistently the same size but does end on a blank line. The first field start with... (6 Replies)
Discussion started by: vestport
6 Replies

6. Shell Programming and Scripting

How to redirect in comma separated csv from grep

Hi, I am newbie in unix. Could someone tell me how do I redirect my grep output to a csv/excel ? I have used below command but the outputs are appearing in one column Not in different column. grep -e cmd -e cmd1 test.txt | cut -f 5 | sort | uniq -c> op.csv I do not understand how do I... (14 Replies)
Discussion started by: kmajumder
14 Replies

7. Shell Programming and Scripting

Need Help - comma inside double quote in comma separated csv,

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

8. UNIX for Dummies Questions & Answers

[solved] Comma separated values to space separated

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

9. Shell Programming and Scripting

Compare 2 files of csv file and match column data and create a new csv file of them

Hi, I am newbie in shell script. I need your help to solve my problem. Firstly, I have 2 files of csv and i want to compare of the contents then the output will be written in a new csv file. File1: SourceFile,DateTimeOriginal /home/intannf/foto/IMG_0713.JPG,2015:02:17 11:14:07... (8 Replies)
Discussion started by: refrain
8 Replies
ststring(3)						    ShapeTools Toolkit Library						       ststring(3)

NAME
stConvertPattern, stSubstituteString, stStrtok, stStrEnter - string handling SYNOPSIS
#include <config.h> #include <sttk.h> char* stConvertPattern (char *pattern); char* stSubstituteString (char *original, char *old, char *new); char* stStrtok (char *string); char* stStrEnter (char *string); DESCRIPTION
stConvertPattern converts sh(1) filename generation patterns to ed(1) string patterns. question (?) gets converted to period (.) asterisk (*) gets converted to a period followed by an asterisk (.*) period (.) will be escaped by a backslash character (.). exclam (!) gets converted to circumflex (^) if it follows an left bracket ([). Otherwise it remains unmodified. The whole pattern will be enclosed in a circumflex (^) as leftmost an a dollar sign ($) as rightmost character. stSubstituteString replaces all occurrences of substring old in original by string new. It returns a pointer to an allocated string that is the result of this operation. Returns NULL if anything goes seriously wrong. stStrtok considers the string string to consist of a sequence of zero or more text tokens separated by whitespace. The first call (with pointer string specified) returns a pointer to the first character of the first token, and will have written a null character into string immediately following the returned token. The function keeps track of its position between separate calls, so that subsequent calls (which must be made with the string argument set to NULL) will work through the string immediately following that token. In this way subsequent calls will work through the string until no tokens remain. When no token remains in string, a NULL pointer is returned. stStrEnter adds the given string to an internal string table and returns a pointer to appropriate string table entry. Equal strings are mapped to equal locations in the table. Equality of two strings in the string table can be checked by simple pointer comparison. SEE ALSO
sh (1), ed (1) sttk-1.7 Thu Jun 24 17:43:33 1993 ststring(3)
All times are GMT -4. The time now is 01:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy