473,520 Members | 2,951 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is that possible of reading the .csv file in column wise and the column have different lengths ?

1 New Member
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to get the output like
coloum 1 :

1
1
1
1
until with in the specific length of only.
What logic i have to use?
4 Weeks Ago #1
1 9884
dev7060
639 Recognized Expert Contributor
Is that possible of reading the .csv file in column wise and the column have different lengths ?
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to get the output like
coloum 1 :

1
1
1
1
until with in the specific length of only.
How certain is it the content of the file is present in the correct format? What language, C or C++?

Read line by line.
Use a variable to keep track of the column.
Add number of spaces for index calculation.
Do not process in case of end of line or end of file.
4 Weeks Ago #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
2990
by: Peter Abel | last post by:
Hi all, I'm working under W2k with Python 2.2.2 (#37, Oct 14 2002, 17:02:34) on win32 I have a file *test_data.txt* with the following content: 0123456789 0123456789 abcdefghi ABCDEFGHIJKLMNOPQ
4
1509
by: KriZ | last post by:
Can any tell me how to read a File Property like the Title, Subject, Author.. I have tried using a file call "Interop.DSOleFile.dll", it works...but It is not Strong Named... I want something strong named that can read the File Property.. Thank You..
3
1229
by: AlanS | last post by:
I am reaing files of different format (PDF, XLS, CVS, XML, HTML). I will take the output and store in in an image field in a database table. The following is the code I am using to read the files. public byte getBinaryFile(string pOutputPath) { FileInfo fi = new FileInfo(pOutputPath); byte fileData = new byte; FileStream fs = new...
2
1214
by: PaulR | last post by:
Hi, We seem to have encountered a bug(or working as deigned?) in the import utility on 8.2 LUW. We are using the standard column and char delimiters of , and " while loading files of type DEL. our extract programs which produce the del files, implement a rule which states if a varchar column contains a " output this as ""
4
9809
by: Oliver Knoll | last post by:
According to my ANSI book, tmpfile() creates a file with wb+ mode (that is just writing, right?). How would one reopen it for reading? I got the following (which works): FILE *tmpFile = tmpfile(); /* write into tmpFile */ ...
11
3006
by: Matt DeFoor | last post by:
I have some log files that I'm working with that look like this: 1000000000 3456 1234 1000000001 3456 1235 1000020002 3456 1223 1000203044 3456 986 etc. I'm trying to read the file backwards and just look at the first column. Here's what I've got so far:
0
1515
by: krishnarjun | last post by:
hi to all, suppose i created a sql table with one field..........then i inserted 5 records on that table....... if i use datagrid for accessing these records it ll shows all the records row wise........is there any tools or coding in C# asp.net web application, so that i can access these recoeds in column-wise....... i hope u ll reply me...
12
2842
by: SAL | last post by:
Hello, Is it possible to read a CSV from the Client, and bind my Datagrid to the data in the CSV file without uploading the file to the Server first? I have tried and in Debug mode on my workstation it works fine, but when I publish the page on our DEV server it doesn't fine the CSV file from the client. Has anyone done this before? ...
4
1549
by: Tom | last post by:
I have a datafile which has a form of 10.10 10.20 10.30 ... 20.10 20.20 20.30 ... 30.10 30.20 30.30 ... .. . . .. . . .. . . it has 500 rows and 10002 colums.
0
7321
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7231
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...
1
7201
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5153
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...
0
3295
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...
0
3295
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1675
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
1
853
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
527
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.