ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Counting Characters (https://www.excelbanter.com/excel-worksheet-functions/127323-counting-characters.html)

Ryan

Counting Characters
 
I have imported a text file that has no delimeters. I would like to count
the first 8 characters and have excell make that field 1, then count
characters 9 thru 16 and make that field 2, ect.... Can anyone help???

Pete_UK

Counting Characters
 
Why not import the file again and specify fixed-width in the Import
Wizard?

Alternatively, you can use

=LEFT(A1,8)

to get the first 8 characters from A1, and

=MID(A1,9,8)

to get the next 8 characters, and

=MID(A1,17,8)

to get the next 8 characters, etc.

Hope this helps.

Pete

Ryan wrote:

I have imported a text file that has no delimeters. I would like to count
the first 8 characters and have excell make that field 1, then count
characters 9 thru 16 and make that field 2, ect.... Can anyone help???



Dave F

Counting Characters
 
First 8 characters can be extracted by =LEFT(A1) and filling down.

9 through 16 can be extracted by =MID(A1,9,5) and filling down.

Dave
--
Brevity is the soul of wit.


"Ryan" wrote:

I have imported a text file that has no delimeters. I would like to count
the first 8 characters and have excell make that field 1, then count
characters 9 thru 16 and make that field 2, ect.... Can anyone help???


Ryan

Counting Characters
 
I am trying to move the data from one worksheet to another. The source
worksheet is called "Demo File". What would my formula be? Thank you very
much for your help so far.

"Pete_UK" wrote:

Why not import the file again and specify fixed-width in the Import
Wizard?

Alternatively, you can use

=LEFT(A1,8)

to get the first 8 characters from A1, and

=MID(A1,9,8)

to get the next 8 characters, and

=MID(A1,17,8)

to get the next 8 characters, etc.

Hope this helps.

Pete

Ryan wrote:

I have imported a text file that has no delimeters. I would like to count
the first 8 characters and have excell make that field 1, then count
characters 9 thru 16 and make that field 2, ect.... Can anyone help???




Ryan

Counting Characters
 
When I get to the last set do I use right?

"Ryan" wrote:

I am trying to move the data from one worksheet to another. The source
worksheet is called "Demo File". What would my formula be? Thank you very
much for your help so far.

"Pete_UK" wrote:

Why not import the file again and specify fixed-width in the Import
Wizard?

Alternatively, you can use

=LEFT(A1,8)

to get the first 8 characters from A1, and

=MID(A1,9,8)

to get the next 8 characters, and

=MID(A1,17,8)

to get the next 8 characters, etc.

Hope this helps.

Pete

Ryan wrote:

I have imported a text file that has no delimeters. I would like to count
the first 8 characters and have excell make that field 1, then count
characters 9 thru 16 and make that field 2, ect.... Can anyone help???




Pete_UK

Counting Characters
 
Ok, Ryan, assume your data is currently in column A of the sheet "Demo
File", and you have another sheet in the same workbook called Sheet2.
Put these formulae in the cells specified in Sheet2:

A1: =LEFT('Demo File'!A1,8)
B1: =MID('Demo File'!A1,9,8)
C1: =MID('Demo File'!A1,17,8)
D1: =MID('Demo File'!A1,25,8)

etc, to cover your data. Note the use of apostrophes, because you have
a space in your sheet name. Then highlight these cells, click <copy
and paste them into cells A2 downwards to cover the extent of your data
in Demo File.

Then highlight all the cells with these formulae in, click <copy, then
Edit | Paste Special | Values (check) | OK then <Enter

This will fix the values in Sheet2, and then you could delete the File
Demo sheet if you no longer need it.

An alternative approach would be to use Data | Text to Columns directly
on your data in the File Demo sheet, and you could split the data into
columns B onwards without any formulae.

Hope this helps.

Pete

Ryan wrote:

I am trying to move the data from one worksheet to another. The source
worksheet is called "Demo File". What would my formula be? Thank you very
much for your help so far.

"Pete_UK" wrote:

Why not import the file again and specify fixed-width in the Import
Wizard?

Alternatively, you can use

=LEFT(A1,8)

to get the first 8 characters from A1, and

=MID(A1,9,8)

to get the next 8 characters, and

=MID(A1,17,8)

to get the next 8 characters, etc.

Hope this helps.

Pete

Ryan wrote:

I have imported a text file that has no delimeters. I would like to count
the first 8 characters and have excell make that field 1, then count
characters 9 thru 16 and make that field 2, ect.... Can anyone help???





Pete_UK

Counting Characters
 
You could use RIGHT for the last set of data, but if your data is not
an exact multiple of 8 characters in length then you may need a
different value than 8 in the formula:

=RIGHT(A1,8) or =RIGHT('File Demo'!A1,8)

Hope this helps.

Pete

Ryan wrote:

When I get to the last set do I use right?

"Ryan" wrote:

I am trying to move the data from one worksheet to another. The source
worksheet is called "Demo File". What would my formula be? Thank you very
much for your help so far.

"Pete_UK" wrote:

Why not import the file again and specify fixed-width in the Import
Wizard?

Alternatively, you can use

=LEFT(A1,8)

to get the first 8 characters from A1, and

=MID(A1,9,8)

to get the next 8 characters, and

=MID(A1,17,8)

to get the next 8 characters, etc.

Hope this helps.

Pete

Ryan wrote:

I have imported a text file that has no delimeters. I would like to count
the first 8 characters and have excell make that field 1, then count
characters 9 thru 16 and make that field 2, ect.... Can anyone help???




Don Guillett

Counting Characters
 
Have you tried
datatext to columnsfixed widthset as desired
or a maco to do the same
or a macro to use LEFT & MID (look in the help index)

--
Don Guillett
SalesAid Software

"Ryan" wrote in message
...
I have imported a text file that has no delimeters. I would like to count
the first 8 characters and have excell make that field 1, then count
characters 9 thru 16 and make that field 2, ect.... Can anyone help???





All times are GMT +1. The time now is 08:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com