01-11-2011
Well, how does the shell know which line feeds are real?
You might write a standard (local shared), postprocessing, sql tool (wrapper) for all to use, and make it encode embedded linefeeds in a printf friendly form, while escaping any printf metacharacters in the flow. It seems unlikely people will enter '\n' or '%' in their text, but with escapes, it would stay '\n' and '%'! It can trim and divert headers, counts, dividers and messages at the same time. It will be like JDBC/ODBC or ESQL, but crude and more work. Why not step up to a RDBMS tool or existing scripting extension for your RDBMS, sybperl or such?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All
At the moment the following code works but ideally i do not want to have to change the original $1
tr "\r" "\n" < "$1" > "$1.fix"
printf "\n" >> "$1.fix"
mv "$1.fix" "$1"
FILE=$1
coffee_out="splitmovie"
coffee_fill="-splitAt"
coffee_end="-self-contained -o output.mov $2"... (1 Reply)
Discussion started by: babajuma
1 Replies
2. Shell Programming and Scripting
Hey there - a bit of background on what I'm trying to accomplish, first off. I am trying to load the data from a pipe delimited file into a database. The loading tool that I use cannot handle embedded newline characters within a field, so I need to scrub them out.
Solutions that I have tried... (7 Replies)
Discussion started by: bbetteridge
7 Replies
3. Shell Programming and Scripting
I have a requirement where i have to read from a .sh file a text lying bet characters like 'SELECT' & ';'...Please help me out in this. I am new to shell scripting. (2 Replies)
Discussion started by: goutam_igate
2 Replies
4. UNIX for Dummies Questions & Answers
Hi ,
I am working on Linux, with ksh93 installed.
The following statement
echo \\n
just prints
\n on this shell.
However on pdksh
echo \\n gives a blank new line as a output.
What is the correct way of printing a new line character on the ksh93? (4 Replies)
Discussion started by: neeto
4 Replies
5. Programming
Hi,
My program uses gl_get_line from libtecla to get user input from terminal. It works fine as long as I enter English at the terminal prompt. However, if I enter other languages, such as Chinese characters, either by typing in or cut-and-paste, the input characters get cleared from terminal... (5 Replies)
Discussion started by: tdw
5 Replies
6. Shell Programming and Scripting
Hi,
I have file in which fields are pipe (|) separated and the record separator is new line (\n). But sometime I am getting a field value which is spread across multiple line. Basically I am getting a file from another system in the below format and needs to process the file and load data into a... (3 Replies)
Discussion started by: satyaatcgi
3 Replies
7. Windows & DOS: Issues & Discussions
I have a txt like this:
638.301 (0.00973985) @ 50+55
the thing I want to do is read the last seven characters from the end of the first line.
how do I do this ?
Thanks in advance and sorry for being DOS only here. (2 Replies)
Discussion started by: pasc
2 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I have the file which has the data :
accctaaccctaaccctaaccctaaccctaaccctaaccctaaccctaac
cctaacccaaccctaaccctaaccctaaccctaaccctaaccctaacccc
taaccctaaccctaaccctaaccctaacctaaccctaaccctaaccctaa
ccctaaccctaaccctaaccctaaccctaacccctaaccctaaccctaaa... (24 Replies)
Discussion started by: rajivn786
24 Replies
9. Programming
Hi,
I want to read extended ASCII characters from keyboard using c language on unix/linux. How to read extended characters from keyboard or by copy-paste in terminal irrespective of locale set in the system. I want to read the input characters from keyboard, store it in an array or some local... (3 Replies)
Discussion started by: sanzee007
3 Replies
10. Programming
Hello,
I have snippet code from Lippman's <<C++ primer>>.
The program is to convert regular decimal (0 ~ 15) numbers to basic hexdecimals. The instruction tells the program will execute by hitting newline at the end. When I tried to run the compiled program, hitting ENTER did not work as... (3 Replies)
Discussion started by: yifangt
3 Replies
LEARN ABOUT LINUX
git-sh-i18n
GIT-SH-I18N(1) Git Manual GIT-SH-I18N(1)
NAME
git-sh-i18n - Git's i18n setup code for shell scripts
SYNOPSIS
. "$(git --exec-path)/git-sh-i18n"
DESCRIPTION
This is not a command the end user would want to run. Ever. This documentation is meant for people who are studying the Porcelain-ish
scripts and/or are writing new ones.
The 'git sh-i18n scriptlet is designed to be sourced (using .) by Git's porcelain programs implemented in shell script. It provides
wrappers for the GNU gettext and eval_gettext functions accessible through the gettext.sh script, and provides pass-through fallbacks on
systems without GNU gettext.
FUNCTIONS
gettext
Currently a dummy fall-through function implemented as a wrapper around printf(1). Will be replaced by a real gettext implementation in
a later version.
eval_gettext
Currently a dummy fall-through function implemented as a wrapper around printf(1) with variables expanded by the git-sh-
i18n--envsubst(1) helper. Will be replaced by a real gettext implementation in a later version.
GIT
Part of the git(1) suite
Git 1.8.5.3 01/14/2014 GIT-SH-I18N(1)