Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Creating data delimited by ASCII code 1 Post 303036246 by wisecracker on Thursday 20th of June 2019 01:26:50 PM
Old 06-20-2019
Hi dasun...
As a starting point you could try something like this and is fully POSIX compliant...
Longhand on OSX 10.14.3, default bash terminal calling dash purely as a demonstration:
Code:
Last login: Thu Jun 20 17:47:09 on ttys000
AMIGA:amiga~> dash
AMIGA:\u\w> CSV=$( printf "\001" )
AMIGA:\u\w> echo '<text1'${CSV}'text2'${CSV}'text3'${CSV}'text4/>' > /tmp/CSV
AMIGA:\u\w> echo '<text1'${CSV}'text2'${CSV}'text3'${CSV}'text4/>' >> /tmp/CSV
AMIGA:\u\w> hexdump -C /tmp/CSV
00000000  3c 74 65 78 74 31 01 74  65 78 74 32 01 74 65 78  |<text1.text2.tex|
00000010  74 33 01 74 65 78 74 34  2f 3e 0a 3c 74 65 78 74  |t3.text4/>.<text|
00000020  31 01 74 65 78 74 32 01  74 65 78 74 33 01 74 65  |1.text2.text3.te|
00000030  78 74 34 2f 3e 0a                                 |xt4/>.|
00000036
AMIGA:\u\w> cat /tmp/CSV
<text1text2text3text4/>
<text1text2text3text4/>
AMIGA:\u\w> exit
AMIGA:amiga~> _

This ASSUMES you want the whole of (binary1) string replacing.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Convert Binary data to ascii data

Friends, I've tried on solaris, but I could n't get ascii data dd if=binaryinputfile bs=1 skip=3800 count=4 | od -t u4 output : INDBU3:/usr/users/FTAMUSER/kk $ dd if=SMP20041006173649188151 bs=1 skip=3800 count=4 | od -t u4 4+0 records in 4+0 records out 0000000 0000000000 0000004... (4 Replies)
Discussion started by: krishna
4 Replies

2. UNIX for Dummies Questions & Answers

Creating flat text file (ASCII)

Hi everybody. I need help and I hope someone is willing to help me out here. My wholesale company is currently moving to new software. The old software is running on a UNIX platform. We need to migrate data from the UNIX system, but our former software provider refuses to assist the data... (5 Replies)
Discussion started by: Wdonero
5 Replies

3. Shell Programming and Scripting

Check whether a given file is in ASCII format and data is tab-delimited

Hi All, Please help me out with a script which checks whether a given file say abc.txt is in ASCII format and data is tab-delimited. If the condition doesn't satisfy then it should generate error code "100" for file not in ASCII format and "105" if it is not in tab-delimited format. If the... (9 Replies)
Discussion started by: Mandab
9 Replies

4. Shell Programming and Scripting

how to check the file data type(ascii or binary)

hi i am receiving a file from one system , i have to verify the format of the file data i.e whether the data is in acii format or binary format, please help thanks in advance satya (1 Reply)
Discussion started by: Satyak
1 Replies

5. UNIX for Dummies Questions & Answers

Sorting data in an ASCII file

Hi,,, is there anyway to sort the data that I have on an ASCII file, using unix? :confused::confused::confused: Thanks (2 Replies)
Discussion started by: cosmologist
2 Replies

6. Shell Programming and Scripting

how to convert data from ASCII to Packed Decimal

Hi All, Please let me know if it is possible to convert data from ASCII to Packed Decimal through Unix? Basically we have ASCII file with numeric data we want to convert that files data to Packed decimal format to send it to main frame. Please let me know if we can do it through unix script.... (1 Reply)
Discussion started by: aloktiwary
1 Replies

7. Shell Programming and Scripting

Import ASCII 28 delimited text file

I have an ASCII 28 delimited text file(non-printable delimiter) with 4 columns along with the header.I need to open this text file in Excel or any other tool to view each column content. Please help.. Thanks (6 Replies)
Discussion started by: aneeta13
6 Replies

8. UNIX for Advanced & Expert Users

Conversion of data - ebcdic to ascii

Hi, I want to convert ebcdic values to ascii values. Are there anyany specific c++ libraries with g++ compiler, which can do it ? gcc version 4.1.2 20080704 (Red Hat 4.1.2-54) (0 Replies)
Discussion started by: tostay2003
0 Replies

9. Shell Programming and Scripting

Bash - binary data to ascii code

Hello, With bash-script (ubunto server) I'm trying to read a binary file and, for each character, give back its ascii code (including extended ascii). For example: HEX => ASCII => PRINT f5 => 245 => õ 50 => 80 => P To load the binary file into a variable I tried in this way: ... (2 Replies)
Discussion started by: math4
2 Replies

10. Homework & Coursework Questions

ASCII comma-delimited

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Hi Guys, I am new on the scripting world and would like ask for help if you can. Here are my questions... (1 Reply)
Discussion started by: mahiwaga
1 Replies
dlags2.f(3)							      LAPACK							       dlags2.f(3)

NAME
dlags2.f - SYNOPSIS
Functions/Subroutines subroutine dlags2 (UPPER, A1, A2, A3, B1, B2, B3, CSU, SNU, CSV, SNV, CSQ, SNQ) DLAGS2 Function/Subroutine Documentation subroutine dlags2 (logicalUPPER, double precisionA1, double precisionA2, double precisionA3, double precisionB1, double precisionB2, double precisionB3, double precisionCSU, double precisionSNU, double precisionCSV, double precisionSNV, double precisionCSQ, double precisionSNQ) DLAGS2 Purpose: DLAGS2 computes 2-by-2 orthogonal matrices U, V and Q, such that if ( UPPER ) then U**T *A*Q = U**T *( A1 A2 )*Q = ( x 0 ) ( 0 A3 ) ( x x ) and V**T*B*Q = V**T *( B1 B2 )*Q = ( x 0 ) ( 0 B3 ) ( x x ) or if ( .NOT.UPPER ) then U**T *A*Q = U**T *( A1 0 )*Q = ( x x ) ( A2 A3 ) ( 0 x ) and V**T*B*Q = V**T*( B1 0 )*Q = ( x x ) ( B2 B3 ) ( 0 x ) The rows of the transformed A and B are parallel, where U = ( CSU SNU ), V = ( CSV SNV ), Q = ( CSQ SNQ ) ( -SNU CSU ) ( -SNV CSV ) ( -SNQ CSQ ) Z**T denotes the transpose of Z. Parameters: UPPER UPPER is LOGICAL = .TRUE.: the input matrices A and B are upper triangular. = .FALSE.: the input matrices A and B are lower triangular. A1 A1 is DOUBLE PRECISION A2 A2 is DOUBLE PRECISION A3 A3 is DOUBLE PRECISION On entry, A1, A2 and A3 are elements of the input 2-by-2 upper (lower) triangular matrix A. B1 B1 is DOUBLE PRECISION B2 B2 is DOUBLE PRECISION B3 B3 is DOUBLE PRECISION On entry, B1, B2 and B3 are elements of the input 2-by-2 upper (lower) triangular matrix B. CSU CSU is DOUBLE PRECISION SNU SNU is DOUBLE PRECISION The desired orthogonal matrix U. CSV CSV is DOUBLE PRECISION SNV SNV is DOUBLE PRECISION The desired orthogonal matrix V. CSQ CSQ is DOUBLE PRECISION SNQ SNQ is DOUBLE PRECISION The desired orthogonal matrix Q. Author: Univ. of Tennessee Univ. of California Berkeley Univ. of Colorado Denver NAG Ltd. Date: November 2011 Definition at line 152 of file dlags2.f. Author Generated automatically by Doxygen for LAPACK from the source code. Version 3.4.1 Sun May 26 2013 dlags2.f(3)
All times are GMT -4. The time now is 01:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy