473,805 Members | 2,034 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Outputting Text in Unix Format

Hello!

Is there a way to output text in a unix format from vb.net? I am trying to complete a CIM load in Progress and I need the data to be in unix format.

I tried using the following code but it left me with a line carriage return in the file (0d0a)

outfilew.Write( group6)
outfilew.Write( Environment.New Line)

Note:
From http://www.developmentnow.com/g/38_2...nguages-vb.htm

Posted via DevelopmentNow. com Groups
http://www.developmentnow.com
Nov 21 '05 #1
5 4499
Lyle,

What is it that you call Unixformat, are you talking about a local code
page, Unix is not only used on the Northpole so it holds as well many types
of code a character.

http://www.geocities.com/Athens/Acad.../fontset.htm#b

Or are you talking about 127bits ASCII what is quiet uniform beside EBCDIC
however the last is as far as I know never used on Unix.

Give us some more information.

Cor
Nov 21 '05 #2

well isn`t it so that

Windows uses cariage return and linefeed VB contstant VBCRLF and Unix
uses only cariage return vb contstant VBCR as a newline char ??

hth

M. posseth
"Lyle A. Sieren" <no****@develop mentnow.com> schreef in bericht
news:f3******** *************** ***********@msn ews.microsoft.c om...
Hello!

Is there a way to output text in a unix format from vb.net? I am trying
to complete a CIM load in Progress and I need the data to be in unix
format.

I tried using the following code but it left me with a line carriage
return in the file (0d0a)

outfilew.Write( group6)
outfilew.Write( Environment.New Line)

Note:
From
http://www.developmentnow.com/g/38_2...nguages-vb.htm

Posted via DevelopmentNow. com Groups
http://www.developmentnow.com

Nov 21 '05 #3
"Lyle A. Sieren" <no****@develop mentnow.com> wrote in message
news:f3******** *************** ***********@msn ews.microsoft.c om...
I tried using the following code but it left me with a line carriage return in the file (0d0a)

outfilew.Write( group6)
outfilew.Write( Environment.New Line)


If this is run on a Windows box, it will use vbCrLf (0d0a) for a line
break. Unix only wants vbLf (0a). Change your code to

outfilew.Write( group6)
outfilew.Write( vbLf)

(or, better still)

outfilew.Write( group6 & vbLf)

HTH,
Phill W.
Nov 21 '05 #4

i was already thinking was it now only the cariage return or the linefeed
??? :-) just checked some verry old source ( VB 5 / 6 ) and yes Phil you
beated me before i could correct it

well it is so long ago that i had to write files to the system for
exchanging data with third party software

and yes we did write those files to Linux \ Unix file shares and they worked
perfectly ( without any strange conversions or what so ever )
by the way Phil W is that 'the' Phil Weber from the good old days on
freevbcode.com and now Devx ? , if so nice to see you again on the web
Phil

regards

Michel Posseth

"Phill. W" <P.A.Ward@o-p-e-n-.-a-c-.-u-k> wrote in message
news:dg******** **@yarrow.open. ac.uk...
"Lyle A. Sieren" <no****@develop mentnow.com> wrote in message
news:f3******** *************** ***********@msn ews.microsoft.c om...
I tried using the following code but it left me with a line carriage

return
in the file (0d0a)

outfilew.Write( group6)
outfilew.Write( Environment.New Line)


If this is run on a Windows box, it will use vbCrLf (0d0a) for a line
break. Unix only wants vbLf (0a). Change your code to

outfilew.Write( group6)
outfilew.Write( vbLf)

(or, better still)

outfilew.Write( group6 & vbLf)

HTH,
Phill W.

Nov 21 '05 #5
THANKS everyone! I used the following code suggested by Phil and it worked perfectly!
outfilew.Write( group6 & vbLf)
From http://www.developmentnow.com/g/38_2...nix-Format.htm

Posted via DevelopmentNow. com Groups
http://www.developmentnow.com
Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2821
by: Andrei Pociu | last post by:
I have a major doubt about outputting text in ASP .NET when using code behind. I know most of the output you gain from a code behind file (.aspx.cs) is outputted to the Webform (.aspx) using labels, datagrids, datalists... Also, I know you can output directly using Response.Write(). But this places the output at the beginning of the file. How can you output the text at a specific place in the HTML code? An example would be when...
5
1857
by: Ash Phillips | last post by:
Ok, I'm not sure how I can explain this but here goes. I have this program that uses a ListView for entries. What I have the program doing is taking all the items from the listview, and writing them to an HTML document. Well what I did in VB6 was get all the info from the listview in a loop routine and write the HTML into a text box. When that was completed I then exported all the text from that text box to an html file.
2
1610
by: Lyle A. Sieren | last post by:
Hello! Sorry...I accidentally posted the last message before finishing it. How do you write a file in unix format from vb.net? I need it in unix format to complete a CIM load in Progress. I am trying to use the following code to write but this is not working properly. outfilew.Write(group6) outfilew.Write(Environment.NewLine) If I take the data and convert it to unix thru a utility it then works properly.
1
1291
by: igotyourdotnet | last post by:
I need to create a text file which I can get working but i need it to be in this format which I'm close but not exactly there yet. format I need: 1234569 BMW 1253252Mercedes 9876522 Lexus 9858252 Jaguar I'm getting this format:
4
3500
by: PengYu.UT | last post by:
Suppose I have a dos format text file. The following python code will print ^M at the end. I'm wondering how to print it in unix format. fh = open(options.filename) for line in fh.readlines() print line, Thanks, Peng
1
2311
by: TimmyNZER | last post by:
Hi, I'm trying to set the format of a "text box" to accept text, I have tried setting the format in the property sheet, but there are only numerical options. I'm sure it must be pretty simple, but it's driving me crazy!! Thanks, Tim Matthews
2
1411
by: Sarahger9 | last post by:
Hi, I am writing a code that requires me to search for words within a text document. I had to build up words one character at a time in order to ignore punctuation when I search for the words. I did this without a problem. But now I am working on building the output again. This is the code I have that outputs the text. Flag is 1 when a keyword is found and substituted. Flag 0 is when no word is found, and it outputs the original word. If the...
0
808
by: =?Utf-8?B?QXNoaXNoIFNheGVuYQ==?= | last post by:
How to change text box format from text to date format or currency format. I tried from property window but same was not change. I want that if I write in text box 1000 and press tab then format autochange and value show in tax box 1,000.00.
1
10024
by: =?Utf-8?B?UmljaA==?= | last post by:
In the Registry at HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Jet \ 4.0 \ Engines \ Text the default key for Text Format is: "Format" = "CSVDelimited" I can use the following OleDB connection string with an OleDB dataAdapter to read a comma delimited text file when "Format" = "CSVDelimited"
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10604
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10103
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7644
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6874
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5676
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4316
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3839
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.