Cast int cell to string in excel file
See original GitHub issueLet’s say I want to parse the attached file.
It has in the A column string
or int
, but I want every cells of that column to be string
.
I tried with this package.yaml
resources:
- name: example
type: table
path: example.xlsx
scheme: file
format: xlsx
encoding: utf-8
mediatype: application/vnd.ms-excel
schema:
fields:
- name: A
type: string
- name: B
type: string
pipeline:
steps:
- type: table-normalize
- type: field-merge
fromNames:
- A
- B
name: AB
and runned this python script
from frictionless import Package
p = Package.from_descriptor('package-issue.yaml')
p.extract()
for r in p.resources:
r.transform()
print(r.to_view())
I have this error when I try to tranform it with field-merge
frictionless.exception.FrictionlessException: [step-error] Step is not valid: "field_merge" raises "sequence item 0: expected str instance, NoneType found"
Is there a way to cast all ints in string
?
Issue Analytics
- State:
- Created a year ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
How to convert number to text in Excel - 4 quick ways - Ablebits
Convert number to string using the Excel TEXT function to adjust the way your numbers will be displayed, or use Format Cells and...
Read more >How to change or convert number to text in Excel?
1. Select the numbers that you want to convert to text. 2. Right click the selected range, and choose the Format Cells item...
Read more >Convert numbers stored as text to numbers - Microsoft Support
Press CTRL + C to copy the cell. Select the cells that have numbers stored as text. On the Home tab, click Paste...
Read more >Converting cell content to string data type in Excel using C# ...
get value from cell: var cellValue = (string)(excelWorksheet.Cells[10, 2] as Excel.Range).Value; · write to cell again (already string) or write ...
Read more >VBA Convert Integer (Number) to String - Automate Excel
VBA Code Examples. In Depth Tutorials, yes. PowerPoint VBA Macro Examples & Tutorial · Sorting · Find and Find and Replace · Cheat...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@shashigharti we have an ETL where we ingest data that we do not produce. The dataset file and format is known, but we cannot change it.
In other words, we want to be able to import any dataset from anywhere on the Internet, “just” by defining a “schema file” on our side that would give to our ETL the rules needed to “normalize” the data before importing it in our database. By normalizing, I mean making sure for example that an int column only contains int, or mapping “pseudo booleans” to a real boolean column, or making sure that some administrative codes are valid, etc.
The ETL output is a normalized table in a postgresql database (each resource ends in a separate table).
To give a bit more details: we currently have our own code base, very similar to Frictionless, and we are evaluating the opportunity to use Frictionless, instead of reinventing the wheel.
To have an example of how we describe our ETL steps currently: https://datahub.incubateur.tech/infrastructure/insitu/-/blob/main/insitu/datasets/numerique.yml
Hope this helps! 😃
We’re releasing
frictionless@5.0.0b11
that now supportsformats.ExcelControl.stringified
: