sed isn't really the right tool for dealing with columns. awk would be the correct tool, it understands columns as columns without weird regex convolutions.
As long as your CSV is actually comma separated -- uses , to separate columns and nowhere else -- this may work:
If your CSV isn't actually a CSV, a recursive parser that understands quotes is required and things start getting hard.
Hello,
I have many csv file, but I would like to delete lines with some values in a column conditionally.
My example look like this,
ex1e, ex2g, ex39, pasg, ssg, mrlc, pc, kb, coop
-112, -53, -177, 64, 62, 71, 1, 487, 20
-101, -61, -53, 0, 32767, 51, 0, ... (6 Replies)
I am trying to remove the ita from this file:
"1234ita","john","smith"
"56789ita","jim","thomas"
the command i am using is:
sed '/^ita/d' infile.csv > outfile.csv
it is running but doing nothing, very rarely use sed so trying to learn it any help would be appreciated (2 Replies)
I have a large CSV files (e.g. 2 million records) and am hoping to do one of two things. I have been trying to use awk and sed but am a newbie and can't figure out how to get it to work. Any help you could offer would be greatly appreciated - I'm stuck trying to remove the colon and wildcards in... (6 Replies)
Hi All,
i have a csv file .
In the 7th column i have data that has line feed in it.
Requirement is to remove the line feed from the 7th column whenever it appears
There are 11 columns in the file
C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11
The value in C7 contains line feed ( Alt + Enter ),... (2 Replies)
I have a data file that has 14 columns. I cannot use awk or perl but sed is installed on my host. I would like to delete a line if fields 10, 11 or twelve is greater than 999.99. How is this done using sed? :wall:
sed '/^*,*,*,*,*,*,*,*,*,*,*,*,*,*,/d' infile
1 2 3 4 ... (2 Replies)
Hello people,
I am having problem to sort, sed and zero padding of column in csv file.
7th column only.
Input of csv file:
1,2,3,4,5,6,4/1/2010 12:00 AM,8
1,2,3,4,5,6,3/11/2010 9:39 AM,8
1,2,3,4,5,6,5/12/2011 3:43 PM,8
1,2,3,4,5,6,12/20/2009 7:23 PM,8
Output:... (5 Replies)
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
LEARN ABOUT DEBIAN
portabase
PORTABASE(1) General Commands Manual PORTABASE(1)NAME
portabase - an easy-to-use personal database application
SYNOPSIS
portabase [ -h | --help | <file> ]
portabase command [ -p password ] [ options ] <fromfile> <tofile>
DESCRIPTION
PortaBase (portable database) is a personal database application that is available for many platforms, including Linux, Mac OS X, Windows,
and Maemo.
PortaBase's features include:
- One data table per file
- String, Integer, Decimal, Boolean, Note (multi-line text), Date,
Time, Calculation, Sequence, Image, and Enum column types
- Add, edit, and delete rows of data
- Custom data views (subsets of the columns in any order)
- Filter the displayed rows using sets of conditions
- Sort the rows by any combination of columns, each in ascending or
descending order
- Optional page navigation buttons, with a custom number of rows per page
- Add, delete, rearrange, and rename columns at any time
- Specify default values for columns
- View summary statistics for columns (total, average, min, max, etc.)
- Import data from CSV, XML, and MobileDB files
- Export data to CSV and XML files
- Command-line format conversions (to and from XML, from MobileDB)
- Data file encryption
- Unicode support
- Pick any available font to use throughout the application
COMMANDS
PortaBase uses the following commands to indicate a command-line file conversion:
fromxml
Create a new PortaBase file from the input XML file.
frommobiledb
Create a new PortaBase file from the input MobileDB file.
fromcsv
Add rows to an existing PortaBase file from the input CSV file.
toxml Create a new XML file from the input PortaBase file.
tocsv Create a new CSV file from the input PortaBase file.
If an encrypted PortaBase file is to be read or created, the following option can be used immediately after the command:
-p <password>
Open or create the encrypted PortaBase file using the given password
The toxml and tocsv commands accept the following options:
-v <view>
Apply the named view before exporting.
-s <sorting>
Apply the named sorting before exporting.
-f <filter>
Apply the named filter before exporting.
The fromcsv command supports one option:
-e <encoding>
Specifies the text encoding of the imported CSV file; options are UTF-8 (the default) and Latin-1.
OPTIONS
PortaBase accepts the following options:
-h, --help
Display usage instructions.
FILES
$HOME/.qt/portabaserc - user-specific settings. Stores information on font, checkbox editing, delete confirmations, etc.
AUTHOR
This manual page was written by Jeremy Bowman <jmbowman@alum.mit.edu>, for the Debian GNU/Linux system (but may be used by others).
April 16, 2010 PORTABASE(1)