Sponsored Content
Top Forums Shell Programming and Scripting Want to remove the last characters from each row of csv using shell script Post 302580601 by clx on Friday 9th of December 2011 02:32:14 AM
Old 12-09-2011
Quote:
Originally Posted by rajak.net
Hi Scott,

This code works great.! Thank you so much for your time and help. Can you please tell me what exactly this code does? Just want to know.

Thanks to everyone who spend their time to help me out in fixing this issue. This is really a useful forum. I appreciate.

Thank you once again

To avoid these problem, use ascii mode while FTPing the file. The default mode is binary. use the following commands to switch between the two.
Code:
ftp> ascii
200 Type set to A.
ftp> binary
200 Type set to I.
ftp>

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to find and remove characters

Hi. I have many files in a folder, and even more in the subfolders. I need a script that finds and removes certain characters (them being /n in this one) in the files in the folder and it's subfolders. So, could someone write me a script that works in Linux, does this: Searchs for "/n" in... (5 Replies)
Discussion started by: Zerby
5 Replies

2. Shell Programming and Scripting

Blank Space is not appending in each row of CSV File - Shell Script

I am calling SQL script in my UNIX Shell script and trying to create the CSV file and my last column value of each row is 23 blank spaces. In my SQL script,the last column is like below. RPAD(' ',23,' ') -- Padding 23 blank Spaces The CSV file is generated but the sapce(23 spaces) is... (2 Replies)
Discussion started by: praka
2 Replies

3. Shell Programming and Scripting

remove row if string is same as previous row

I have data like: Blue Apple 6 Red Apple 7 Yellow Apple 8 Green Banana 2 Purple Banana 8 Orange Pear 11 What I want to do is if $2 in a row is the same as $2 in the previous row remove that row. An identical $2 may exist more than one time. So the out file would look like: Blue... (4 Replies)
Discussion started by: dcfargo
4 Replies

4. Shell Programming and Scripting

shell script to remove extra commas from CSV outp file

Name,,,,,,,,,,,,,,,,,,,,Domain,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Contact,Phone,Email,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Location -----------------------,------------------------------------------------,-------,-----,---------------------------------,------------------------------------ ----... (1 Reply)
Discussion started by: sreenath1037
1 Replies

5. UNIX for Dummies Questions & Answers

Shell Script: Traverse Database Table Row by Row

Hello Everyone, My issue is that I want to traverse a database table row by row and do some action on the value retrieved in each row. I have gone through a lot of shell script questions/posts. I could find row by row traversal of a file but not a database table. Please help. Thanks &... (5 Replies)
Discussion started by: ahsan.asghar
5 Replies

6. Shell Programming and Scripting

Remove ^? characters in shell variables on using backspace

Friends, I observed a peculiar problem in shell. if I set a variable using standard input and backspace was used by the user, then the variable get ^? characters embedded in the variable. ### echo "Enter value for X=" read X echo $X expr $X + 1 ### If the variable is echoed, then there... (3 Replies)
Discussion started by: sachinverma
3 Replies

7. Shell Programming and Scripting

Remove line breaks in csv file using shell script

Hi All, I've a csv file in which the record is getting break into 1 line or more than one line. I want to combine those splits into one line and remove the unwanted character existing in the record i.e. double quote symbol ("). The line gets break only when the record contains double... (4 Replies)
Discussion started by: rajak.net
4 Replies

8. Shell Programming and Scripting

Shell script that should remove unnecessary commas between double quotes in CSV file

i have data as below 123,"paul phiri",paul@yahoo.com,"po.box 23, BT","Eco Bank,Blantyre,Malawi" i need an output to be 123,"paul phiri",paul@yahoo.com,"po.box 23 BT","Eco Bank Blantyre Malawi" (5 Replies)
Discussion started by: mathias23
5 Replies

9. Shell Programming and Scripting

Need a piece of shell scripting to remove column from a csv file

Hi, I need to remove first column from a csv file and i can do this by using below command. cut -f1 -d, --complement Mytest.csv I need to implement this in shell scripting, Whenever i am using the above command alone in command line it is working fine. I have 5 files in my directory and... (3 Replies)
Discussion started by: Samah
3 Replies

10. Shell Programming and Scripting

Outputting characters after a given string and reporting the characters in the row below --sed

I have this fastq file: @M04961:22:000000000-B5VGJ:1:1101:9280:7106 1:N:0:86 GGGGGGGGGGGGCATGAAAACATACAAACCGTCTTTCCAGAAATTGTTCCAAGTATCGGCAACAGCTTTATCAATACCATGAAAAATATCAACCACACCA +test-1 GGGGGGGGGGGGGGGGGCCGGGGGFF,EDFFGEDFG,@DGGCGGEGGG7DCGGGF68CGFFFGGGG@CGDGFFDFEFEFF:30CGAFFDFEFF8CAF;;8... (10 Replies)
Discussion started by: Xterra
10 Replies
BPM(1)							    BSD General Commands Manual 						    BPM(1)

NAME
bpm -- menu-based binary package manager SYNOPSIS
bpm [-hnVv] [-b baseURL] [-m machine] [-r release] [-w seconds] DESCRIPTION
The bpm command is used to locate and install binary packages from any reachable URL. The following command-line options are supported: -b baseURL Specify a base URL from which to download binary packages. The default URL is ftp://ftp.NetBSD.org/pub/pkgsrc/packages. -h Print a help message and then exit. -m machine Use machine as the machine architecture to be used, instead of that returned by uname(1). -n Don't actually execute the commands to add the package. -r release Use release as the operating system release to be used, instead of that returned by uname(1). -V Print version number and exit. -v Turn on verbose output. -w seconds The number of seconds to wait after displaying an error message and returning to normal menu operations. bpm provides a menu-based binary package manager for NetBSD. bpm first connects to the URL using ftp(1), and displays a list of categories for which binary packages exist. If no categories are displayed, it could be that the machine architecture or operating system release string have been wrongly interpreted, and that it will be necessary to override this values by means of the command line options. Within a category, a list of packages will be displayed, and by selecting one using the number assigned to it, the package will be downloaded automat- ically, and installed, using the pkg_add(1) utility. It is also possible to change the category currently being examined, and to quit from the utility, simply by selecting the appropriate choices on the menu. ENVIRONMENT
The environment variables which govern the behavior of ftp(1) and pkg_add(1) are valid for bpm. SEE ALSO
ftp(1), pkg_add(1), uname(1) AUTHORS
The bpm utility was written by Alistair Crooks <agc@NetBSD.org>. BSD
August 3, 2007 BSD
All times are GMT -4. The time now is 05:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy