script to sort a string of numerical data in set fields

So, I will be working with someone and basically we are trying to build a form that is submitted most likely via the web and the data is just a string of numbers.

like:

19383882872201110929282821818182827349190102837364718191001932873711

Now, each number is part of a numerical value of some data they want. It will always be sent like this in plain text but there is a pattern to it. Like the first 5 digits are data entry A, the next 8 digits are data entry B, the next 3 digits are for C and so forth.

Then I need to output it so it is like this

A = 19383
B = 88287220
C = 111

I don't know all the details but these numbers plug into some system for data analysis and I just need to be able to organize the data for whomever is going to input it. I have no clue if this will be done email or web form. I told them to just send me a plain text file to begin with. I will have to split up each huge string of numbers and assign them to the proper value. I also do not know the patterns yet, but every giant string of numbers will contain the same amount of digits and be in the same pattern.

Now, lets say it is over web, I could have php invoke the shell or run a shell script correct?

Thanks in advance for any insight

-tl

I didn't understand you properly, but if you want to want to split the fields:

there are various ways:

string="19383882872201110929282821818182827349190102837364718191001932873711"

A=$(echo $string | cut -c1-5)
B=$(echo $string | cut -c6-13)
C=$(echo $string | cut -c14-16)
echo $A $B $C

or

awk -v  string="19383882872201110929282821818182827349190102837364718191001932873711" 'BEGIN {A=substr(string,1,5);B=substr(string,6,8);C=substr(string,14,3);print A,B,C}'

Thanks, but I think there are tons and tons of these files with just numeric strings and they need to be formatted into certain fields.

So if I copied all these files to a folder, and then ran a script that would loop through said folder and grab each set of numbers and put them into a specific value, I think that is what I want to do.

Again, I am not sure of some of the details as I am being asked for help by someone else in a completely different area of where I work. I have no idea what this data is even for.

/home/forum->cat f
1938388287220111092928282181818
5678388287220111092928282181818
1938388287220111092928282181818
1938388286660111666609082181818
1938388287220111092928282145678
1938388287545676788968999181818
1938388287220111092928282181818
1938388287220111092928282181818
/home/forum->awk '{A=substr($0,1,5);B=substr($0,6,8);C=substr($0,14,3);print A,B,C}' f
19383 88287220 111
56783 88287220 111
19383 88287220 111
19383 88286660 111
19383 88287220 111
19383 88287545 676
19383 88287220 111
19383 88287220 111
/home/forum->

you can put more than one files after the command. or even wild card.

Here is the basic code

cd "your path where your files are"

DESTPATH="Your dest path"
for filename in *;
do
    
X=`cat $filename |cut -c1-5`
Y=`cat $filename |cut -c6-13`
Z=`cat $filename |cut -c14-16`

echo "A = $X" > /DESTPATH/$filename.new
echo "B = $Y" >> /DESTPATH/$filename.new
echo "C= $Z" >> /DESTPATH/$filename.new
done